<template>
    <el-tabs  v-model="activeName">
        <el-tab-pane v-for="(title, index) of titles" :key="index"
                     class="content" :label="title.name" :name="title.name">
            <router-link  :to="title.path">{{title.name}}</router-link>
        </el-tab-pane>
    </el-tabs>
</template>

<script>
    import {Tabs,TabPane} from 'element-ui'

    export default {
        name: "NavTab",
        components:{
            'el-tabs':Tabs,
            'el-tab-pane':TabPane
        },
        props: {
            titles: {
                type: Array,
                require: true
            }
        },
        data(){
          return {
              activeName:"首页"
          }
        },
        methods: {
            linkClick(title){
                this.$emit("nav-click", title.isBeSearch);
            }
        }
    }
</script>

<style scoped>

</style>